# 封装一个学生类，有姓名，有年龄，有性别，有英语成绩，数学成绩，语文成绩，
#       封装方法，求单个学生的总分，平均分，以及打印学生的信息。

class student( object ):

    def __init__( self, name, age, sex, englishscore, mathscore, chinesescore):
        self.name = name
        self.age = age
        self.sex = sex
        self.englishscore = englishscore
        self.chinesescore = chinesescore
        self.mathscore = mathscore
    def get_totle( self ):
        return self.englishscore + self.mathscore + self.chinesescore

    def get_ave( self ):
        return (self.englishscore + self.mathscore + self.chinesescore)/3
    
    def printstudent( self ):
        print('Name:%s \n Age:%d \n Sex:%s \n English:%d \n Math:%d \n Chinese:%d ' %(self.name, self.age, self
        .sex, self.englishscore, self.mathscore, self.chinesescore))

student1 = student("whh", 20, "male", 77, 88, 99)
print( student1.get_totle() )
print( student1.get_ave() )
student1.printstudent()


